package com.xk857.school.controller.pub;


import com.xk857.school.req.CourierREQ;
import com.xk857.school.service.ICourierService;
import com.xk857.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 代取快递 前端控制器
 * </p>
 *
 * @author CV大魔王
 * @since 2021-05-02
 */
@Api(value = "快递代拿接口(公共)", tags = "快递代拿接口(公共)")
@RestController
@RequestMapping("/pub/courier")
public class PubCourierController {


    @Autowired
    private ICourierService courierService;


    @ApiOperation("条件分页查询")
    @PostMapping("/search")
    public Result search(@RequestBody CourierREQ req) {
        return courierService.searchPagePub(req);
    }

    @ApiOperation("分组查询所有学校名称")
    @GetMapping("/school")
    public Result searchSchoolList() {
        return courierService.getAllSchoolNameGroup();
    }


    @ApiOperation("分组查询所有班级名称")
    @GetMapping("/class")
    public Result searchClassList() {
        return courierService.getAllClassGroup();
    }
}
